import { defHttp } from "/@/utils/http/axios";
import { CollegeModel } from "/@/api/model/collegeModel";
import { PageParams, PageResult } from "/@/api/model/pageModel";

enum Api {
  GetCollegePage = "/college/page",
  SaveCollege = "/college/save",
  UpdateCollege = "/college/update",
  GetSelectList = "/college/selectList",
}

export const getCollegePageApi = (params: PageParams) =>
  defHttp.get<PageResult<CollegeModel>>({ url: Api.GetCollegePage, params });

export const saveCollegeApi = (params: CollegeModel) =>
  defHttp.post<void>({ url: Api.SaveCollege, params });

export const updateCollegeApi = (params: CollegeModel) =>
  defHttp.put<void>({ url: Api.UpdateCollege, params });

export const getSelectListApi = () => defHttp.get<CollegeModel>({ url: Api.GetSelectList });
